EnterInfoCtrl.$inject = [ '$scope',  '$remote', '$locale', '$log','$targets', '$timeout', '$sessionService','eventService','$certUtilService','$certFactoryService','$cookieService','$print2','$contextProvider'];
function EnterInfoCtrl($scope,  $remote, $locale, $log, $targets,$timeout, $sessionService,eventService,$certUtilService,  $certFactoryService,$cookieService,$print2,$contextProvider) {

	//	初始化
	$scope.init = function(){
		var Str=window.location.search;
		$scope.AccountingNo = getUrlParam('AccountingNo');
		$scope.MsgPhone = getUrlParam('MsgPhone');
		$scope.Operator1 = false;
		$scope.Operator2 = false;
		$scope.SpecialOper1 = false;
		$scope.SpecialOper2 = false;
		$scope.SmartCard = false;
		alert(123);
		// 请求申请数据
		$scope.searchData();
	}
	
//	查询页面初始化数据
	$scope.searchData=function(){
		$scope.oparam = {
				"AccountingNo":$scope.AccountingNo,
				"Phone" : $scope.MsgPhone
		}
		$remote.post("/eweb/EntPayAcCheckQry.do", $scope.oparam, function(data){
			$scope.AccountTitle=data.AccountTitle;
		});
	}
	
	// 重置
	$scope.clearForm = function(){

		// 普通版操作员复选框
		$scope.EbankCommonIsorno = false;
		$scope.Operator1 = false;
		$scope.Operator2 = false;
		
		// 专业版操作员复选框 
		$scope.EbankSpecialIsorno = false;
		$scope.SpecialOper1 = false;
		$scope.SpecialOper2 = false;
		
		// 结贷一卡通复选框
		$scope.SmartCard = false;
		
		$scope.checkOperator1();
		$scope.checkOperator2();
		$scope.checkSpecialOper1();
		$scope.checkSpecialOper2();
		$scope.checkSmartCard();
		
		$scope.selectCheckBox("4");
		$scope.selectCheckBox("5");
		
	}
	
	/** ********单位签约业务在线申请********* */
	$scope.selectCheckBox=function(val){
		if(val===4){
			if($scope.EbankCommonIsorno){
				$(".table4").css("display","block");
			}else{
				$(".table4").css("display","none");
				$("#Operator1").removeAttr("checked");
				$("#Operator2").removeAttr("checked");
				$("#Operator1Name").val("");
				$("#Operator1PapersNumber").val("");
				$("#Operator1Mobile").val("");
				$("#Operator1Email").val("");
				$("#Operator2Name").val("");
				$("#Operator2PapersNumber").val("");
				$("#Operator2Mobile").val("");
				$("#Operator2Email").val("");
				$("#Operator1Name").attr("disabled","true");
				$("#Operator1PapersStyle").attr("disabled","true");
				$("#Operator1PapersNumber").attr("disabled","true");
				$("#Operator1Mobile").attr("disabled","true");
				$("#Operator1Email").attr("disabled","true");
				$("#operator1Name_f").text("");
				$("#operator1PapersStyle_f").text("");
				$("#operator1PapersNumber_f").text("");
				$("#operator1Mobile_f").text("");
				$("#operator1Email_f").text("");
				
				$("#Operator2Name").attr("disabled","true");
				$("#Operator2PapersStyle").attr("disabled","true");
				$("#Operator2PapersNumber").attr("disabled","true");
				$("#Operator2Mobile").attr("disabled","true");
				$("#Operator2Email").attr("disabled","true");
				$("#operator2Name_f").text("");
				$("#operator2PapersStyle_f").text("");
				$("#operator2PapersNumber_f").text("");
				$("#operator2Mobile_f").text("");
				$("#operator2Email_f").text("");
				$scope.Operator1PapersStyle=$scope.PapersStyleList[0];
				$scope.Operator2PapersStyle=$scope.PapersStyleList[0];
			}
		}
		if(val==5){
			if($scope.EbankSpecialIsorno||$scope.EbankSpecialIsorno=='1'){
				$(".table5").css("display","block");
			}else{
				$(".table5").css("display","none");
				
				$scope.SpecialOper1 = false;
				$scope.SpecialOper2 = false;
				$scope.checkSpecialOper1();
				$scope.checkSpecialOper2();
				
//				$("#SpecialOper1").removeAttr("checked");
//				$("#SpecialOper2").removeAttr("checked");
				
//				$scope.SpecialOper1Style = "";
//				$scope.SpecialOper1PapersNumber = "";
//				$scope.SspecialOper1Mobile = "";
//				$scope.SspecialOper1Email = "";
//				$scope.SpecialOper2Style = "";
//				$scope.SpecialOper2PapersNumber = "";
//				$scope.SspecialOper2Mobile = "";
//				$scope.SspecialOper2Email = "";
				
				$("#specialOper1Style_f").text("");
				$("#specialOper1Name_f").text("");
				$("#specialOper1PapersStyle_f").text("");
				$("#specialOper1PapersNumber_f").text("");
				$("#specialOper1Mobile_f").text("");
				$("#specialOper1Email_f").text("");
				$("#specialOper1PhoneBank_f").text("");
				
				$("#SpecialOper1Style").attr("disabled","true");
				$("#SpecialOper1VocationStyle").attr("disabled","true");
				$("#SpecialOper1Name").attr("disabled","true");
				$("#SpecialOper1PapersStyle").attr("disabled","true");
				$("#SpecialOper1PapersNumber").attr("disabled","true");
				$("#SspecialOper1Mobile").attr("disabled","true");
				$("#SspecialOper1Email").attr("disabled","true");
				$("#SspecialOper1PhoneBank").attr("disabled","true");
				
				$("#specialOper2Style_f").text("");
				$("#specialOper2Name_f").text("");
				$("#specialOper2PapersStyle_f").text("");
				$("#specialOper2PapersNumber_f").text("");
				$("#specialOper2Mobile_f").text("");
				$("#specialOper2Email_f").text("");
				$("#specialOper2PhoneBank_f").text("");
				
				$("#SpecialOper2Style").attr("disabled","true");
				$("#SpecialOper2VocationStyle").attr("disabled","true");
				$("#SpecialOper2Name").attr("disabled","true");
				$("#SpecialOper2PapersStyle").attr("disabled","true");
				$("#SpecialOper2PapersNumber").attr("disabled","true");
				$("#SpecialOper2Mobile").attr("disabled","true");
				$("#SpecialOper2Email").attr("disabled","true");
				$("#SspecialOper2PhoneBank").attr("disabled","true");
			}
		}
	}
	
	
	// 网上银行普通版
	// 操作员1
	$scope.checkOperator1=function(){
		if($("#Operator1").attr("checked")){
			$("#Operator1Name").removeAttr("disabled");
			$("#Operator1PapersStyle").removeAttr("disabled");
			$("#Operator1PapersNumber").removeAttr("disabled");
			$("#Operator1Mobile").removeAttr("disabled");
			$("#Operator1Email").removeAttr("disabled");
			$("#operator1Name_f").text("*").attr("color","red");
			$("#operator1PapersStyle_f").text("*").attr("color","red");
			$("#operator1PapersNumber_f").text("*").attr("color","red");
			$("#operator1Mobile_f").text("*").attr("color","red");
			$("#operator1Email_f").text("*").attr("color","red");
		}else{
			$("#Operator1Name").attr("disabled","true");
			$("#Operator1PapersStyle").attr("disabled","true");
			$("#Operator1PapersNumber").attr("disabled","true");
			$("#Operator1Mobile").attr("disabled","true");
			$("#Operator1Email").attr("disabled","true");
			$("#operator1Name_f").text("");
			$("#operator1PapersStyle_f").text("");
			$("#operator1PapersNumber_f").text("");
			$("#operator1Mobile_f").text("");
			$("#operator1Email_f").text("");
			$("#Operator1Name").val("");
			$scope.Operator1Name="";
			$("#Operator1PapersNumber").val("");
			$scope.Operator1PapersNumber="";
			$("#Operator1Mobile").val("");
			$scope.Operator1Mobile="";
			$("#Operator1Email").val("");
			$scope.Operator1Email="";
			$scope.Operator1PapersStyle=$scope.PapersStyleList[0];
		}
	};
	
	// 网上银行普通版
	// 操作员2
	$scope.checkOperator2=function(){
		if($("#Operator2").attr("checked")){
			$("#Operator2Name").removeAttr("disabled");
			$("#Operator2PapersStyle").removeAttr("disabled");
			$("#Operator2PapersNumber").removeAttr("disabled");
			$("#Operator2Mobile").removeAttr("disabled");
			$("#Operator2Email").removeAttr("disabled");
			$("#operator2Name_f").text("*").attr("color","red");
			$("#operator2PapersStyle_f").text("*").attr("color","red");
			$("#operator2PapersNumber_f").text("*").attr("color","red");
			$("#operator2Mobile_f").text("*").attr("color","red");
			$("#operator2Email_f").text("*").attr("color","red");
		}else{
			$("#Operator2Name").attr("disabled","true");
			$("#Operator2PapersStyle").attr("disabled","true");
			$("#Operator2PapersNumber").attr("disabled","true");
			$("#Operator2Mobile").attr("disabled","true");
			$("#Operator2Email").attr("disabled","true");
			$("#operator2Name_f").text("");
			$("#operator2PapersStyle_f").text("");
			$("#operator2PapersNumber_f").text("");
			$("#operator2Mobile_f").text("");
			$("#operator2Email_f").text("");
			$("#Operator2Name").val("");
			$scope.Operator2Name="";
			$("#Operator2PapersNumber").val("");
			$scope.Operator2PapersNumber="";
			$("#Operator2Mobile").val("");
			$scope.Operator2Mobile="";
			$("#Operator2Email").val("");
			$scope.Operator2Email="";
			$scope.Operator2PapersStyle=$scope.PapersStyleList[0];
		}
	};
	
	
	// 网上银行专业版-操作员1
	$scope.checkSpecialOper1=function(){
		if($scope.SpecialOper1){
			$("#specialOper1Style_f").text("*").attr("color","red");
			$("#specialOper1Name_f").text("*").attr("color","red");
			$("#specialOper1PapersStyle_f").text("*").attr("color","red");
			$("#specialOper1PapersNumber_f").text("*").attr("color","red");
			$("#specialOper1Mobile_f").text("*").attr("color","red");
			$("#specialOper1Email_f").text("*").attr("color","red");
			
			
			$("#SpecialOper1Style").removeAttr("disabled");
			$("#SpecialOper1VocationStyle").removeAttr("disabled");
			$("#SpecialOper1Name").removeAttr("disabled");
			$("#SpecialOper1PapersStyle").removeAttr("disabled");
			$("#SpecialOper1PapersNumber").removeAttr("disabled");
			$("#SpecialOper1Mobile").removeAttr("disabled");
			$("#SpecialOper1Email").removeAttr("disabled");
			$("#SpecialOper1PhoneBank").removeAttr("disabled");
		}else{
			$("#specialOper1Name_f").text("");
			$("#specialOper1PapersStyle_f").text("");
			$("#specialOper1PapersNumber_f").text("");
			$("#specialOper1Mobile_f").text("");
			$("#specialOper1Email_f").text("");
			
			$("#SpecialOper1Name").attr("disabled","true");
			$("#SpecialOper1PapersStyle").attr("disabled","true");
			$("#SpecialOper1PapersNumber").attr("disabled","true");
			$("#SpecialOper1Mobile").attr("disabled","true");
			$("#SpecialOper1Email").attr("disabled","true");
			
			$scope.SpecialOper1Name="";
			$scope.SpecialOper1PapersStyle="";
			$scope.SpecialOper1PapersNumber="";
			$scope.SpecialOper1Mobile="";
			$scope.SpecialOper1Email="";
			$scope.SpecialOper1PapersStyle=$scope.PapersStyleList[0];
		}
	};
	
	
	// 网上银行专业版-操作员2
	$scope.checkSpecialOper2=function(){
		if($scope.SpecialOper2){
			$("#specialOper2Style_f").text("*").attr("color","red");
			$("#specialOper2Name_f").text("*").attr("color","red");
			$("#specialOper2PapersStyle_f").text("*").attr("color","red");
			$("#specialOper2PapersNumber_f").text("*").attr("color","red");
			$("#specialOper2Mobile_f").text("*").attr("color","red");
			$("#specialOper2Email_f").text("*").attr("color","red");
			
			
			$("#SpecialOper2Style").removeAttr("disabled");
			$("#SpecialOper2VocationStyle").removeAttr("disabled");
			$("#SpecialOper2Name").removeAttr("disabled");
			$("#SpecialOper2PapersStyle").removeAttr("disabled");
			$("#SpecialOper2PapersNumber").removeAttr("disabled");
			$("#SpecialOper2Mobile").removeAttr("disabled");
			$("#SpecialOper2Email").removeAttr("disabled");
			$("#SpecialOper2PhoneBank").removeAttr("disabled");
		}else{
			$("#specialOper2Name_f").text("");
			$("#specialOper2PapersStyle_f").text("");
			$("#specialOper2PapersNumber_f").text("");
			$("#specialOper2Mobile_f").text("");
			$("#specialOper2Email_f").text("");
			
			$("#SpecialOper2Name").attr("disabled","true");
			$("#SpecialOper2PapersStyle").attr("disabled","true");
			$("#SpecialOper2PapersNumber").attr("disabled","true");
			$("#SpecialOper2Mobile").attr("disabled","true");
			$("#SpecialOper2Email").attr("disabled","true");
			
			$scope.SpecialOper2Name="";
			$scope.SpecialOper2PapersStyle="";
			$scope.SpecialOper2PapersNumber="";
			$scope.SpecialOper2Mobile="";
			$scope.SpecialOper2Email="";
			$scope.SpecialOper2PapersStyle=$scope.PapersStyleList[0];
		}
	};
	
	// 判断 是否与普通操作员一致  单选框是否可用
	function isSameEnable() {
		// 当选择一个操作员是可用
		if ($scope.SpecialOper2 || $scope.SpecialOper1 ) {
			$("#isSame1").removeAttr("disabled");
			$("#isSame2").removeAttr("disabled");
			return true;
		} else {
			$("#isSame1").attr("disabled","true");
			$("#isSame2").attr("disabled","true");
		}
		return false;
	}
	
	// 结贷一卡通
	$scope.checkSmartCard = function(){
		if($scope.SmartCard){
			$("#cardholderName_f").text("*").attr("color","red");
			$("#contactPhone_f").text("*").attr("color","red");
			$("#documentType_f").text("*").attr("color","red");
			$("#identiNumber_f").text("*").attr("color","red");
			
			$("#CardholderName").removeAttr("disabled");
			$("#ContactPhone").removeAttr("disabled");
			$("#DocumentType").removeAttr("disabled");
			$("#IdentiNumber").removeAttr("disabled");
		} else {
			$("#cardholderName_f").text("");
			$("#contactPhone_f").text("");
			$("#documentType_f").text("");
			$("#identiNumber_f").text("");
			
			$("#CardholderName").attr("disabled","true");
			$("#ContactPhone").attr("disabled","true");
			$("#DocumentType").attr("disabled","true");
			$("#IdentiNumber").attr("disabled","true");
			
			$scope.CardholderName="";
			$scope.ContactPhone="";
			$scope.DocumentType="";
			$scope.IdentiNumber="";
		}
	};
	
	
	// 证件种类
	$scope.PapersStyleList= [{
		"value" : "A", "name" : "身份证"
	}, {
		"value" : "E","name" : "护照"
	}, {
		"value" : "C","name" : "军官证"
	}, {
		"value" : "I","name" : "文职干部证 "
	},{
		"value" : "D","name" : "警官证"
	}, {
		"value" : "J","name" : "士兵证"
	}, {
		"value" : "F","name" : "港、澳、台通行证"
	}, {
	    "value" : "B","name" : "户口簿"
	}];
	
	// 点击完成按钮
	$scope.finish = function() {
		
		// 校验提交参数
		var validate = validateParam();
		
		if (validate) {
			// 发送异步请求
			infoAddRemote();
		}
	}
	
	/**
	 * 校验提交参数
	 */
	function validateParam() {
		if (!$scope.Operator1 && !$scope.Operator2 && !$scope.SpecialOper1 && !$scope.SpecialOper2 && !$scope.SmartCard) {
			alert("请输入补录信息");
			return false;
		}
		
		// 普通版操作员1
		if ($scope.Operator1) {
			if (!$scope.Operator1Name) {
				alert("姓名不能为空");
				$("#Operator1Name").focus();
				return false;
			}
			if (!$scope.Operator1PapersStyle) {
				alert("证件类型不能为空");
				$("#Operator1PapersStyle").focus();
				return false;
			}
			if (!$scope.Operator1PapersNumber) {
				alert("证件号码不能为空");
				$("#Operator1PapersNumber").focus();
				return false;
			}
			if (!checkId($scope.Operator1PapersNumber)) {
				alert("证件号码格式错误");
				$("#Operator1PapersNumber").focus();
				return false;
			}
			if (!$scope.Operator1Mobile) {
				alert("手机号码不能为空");
				$("#Operator1Mobile").focus();
				return false;
			}
			if (!myPhone.test($.trim($scope.Operator1Mobile))) {
				alert("手机号码格式错误");
				$("#Operator1Mobile").focus();
				return false;
			}
			if (!$scope.Operator1Email) {
				alert("电子邮箱不能为空");
				$("#Operator1Email").focus();
				return false;
			}
			if (!isEmail($scope.Operator1Email)) {
				alert("电子邮箱格式不正确");
				$("#Operator1Email").focus();
				return false;
			}
		}
		
		// 普通版操作员2
		if ($scope.Operator2) {
			if (!$scope.Operator2Name) {
				alert("姓名不能为空");
				$("#Operator2Name").focus();
				return false;
			}
			if (!$scope.Operator2PapersStyle) {
				alert("证件类型不能为空");
				$("#Operator2PapersStyle").focus();
				return false;
			}
			if (!$scope.Operator2PapersNumber) {
				alert("证件号码不能为空");
				$("#Operator2PapersNumber").focus();
				return false;
			}
			if (!checkId($scope.Operator2PapersNumber)) {
				alert("证件号码格式错误");
				$("#Operator2PapersNumber").focus();
				return false;
			}
			if (!$scope.Operator2Mobile) {
				alert("手机号码不能为空");
				$("#Operator2Mobile").focus();
				return false;
			}
			if (!myPhone.test($.trim($scope.Operator2Mobile))) {
				alert("手机号码格式错误");
				$("#Operator2Mobile").focus();
				return false;
			}
			if (!$scope.Operator2Email) {
				alert("电子邮箱不能为空");
				$("#Operator2Email").focus();
				return false;
			}
			if (!isEmail($scope.Operator2Email)) {
				alert("电子邮箱格式不正确");
				$("#Operator2Email").focus();
				return false;
			}
		}
		
		
		// 专业版操作员1
		if ($scope.SpecialOper1) {
			if (!$scope.SpecialOper1Name) {
				alert("姓名不能为空");
				$("#SpecialOper1Name").focus();
				return false;
			}
			if (!$scope.SpecialOper1PapersStyle) {
				alert("证件类型不能为空");
				$("#SpecialOper1PapersStyle").focus();
				return false;
			}
			if (!$scope.SpecialOper1PapersNumber) {
				alert("证件号码不能为空");
				$("#SpecialOper1PapersNumber").focus();
				return false;
			}
			if (!checkId($scope.SpecialOper1PapersNumber)) {
				alert("证件号码格式错误");
				$("#SpecialOper1PapersNumber").focus();
				return false;
			}
			if (!$scope.SpecialOper1Mobile) {
				alert("手机号码不能为空");
				$("#SpecialOper1Mobile").focus();
				return false;
			}
			if (!myPhone.test($.trim($scope.SpecialOper1Mobile))) {
				alert("手机号码格式错误");
				$("#SpecialOper1Mobile").focus();
				return false;
			}
			if (!$scope.SpecialOper1Email) {
				alert("电子邮箱不能为空");
				$("#SpecialOper1Email").focus();
				return false;
			}
			if (!isEmail($scope.SpecialOper1Email)) {
				alert("电子邮箱格式不正确");
				$("#SpecialOper1Email").focus();
				return false;
			}
		}
		
		// 专业版操作员2
		if ($scope.SpecialOper2) {
			if (!$scope.SpecialOper2Name) {
				alert("姓名不能为空");
				$("#SpecialOper2Name").focus();
				return false;
			}
			if (!$scope.SpecialOper2PapersStyle) {
				alert("证件类型不能为空");
				$("#SpecialOper2PapersStyle").focus();
				return false;
			}
			if (!$scope.SpecialOper2PapersNumber) {
				alert("证件号码不能为空");
				$("#SpecialOper2PapersNumber").focus();
				return false;
			}
			if (!checkId($scope.SpecialOper2PapersNumber)) {
				alert("证件号码格式错误");
				$("#SpecialOper2PapersNumber").focus();
				return false;
			}
			if (!$scope.SpecialOper2Mobile) {
				alert("手机号码不能为空");
				$("#SpecialOper2Mobile").focus();
				return false;
			}
			if (!myPhone.test($.trim($scope.SpecialOper2Mobile))) {
				alert("手机号码格式错误");
				$("#SpecialOper2Mobile").focus();
				return false;
			}
			if (!$scope.SpecialOper2Email) {
				alert("电子邮箱不能为空");
				$("#SpecialOper2Email").focus();
				return false;
			}
			if (!isEmail($scope.SpecialOper2Email)) {
				alert("电子邮箱格式不正确");
				$("#SpecialOper2Email").focus();
				return false;
			}
		}
		
		// 结贷一卡通 
		if ($scope.SmartCard) {
			if (!$scope.CardholderName) {
				alert("持卡人姓名不能为空");
				$("#CardholderName").focus();
				return false;
			}
			if (!$scope.ContactPhone) {
				alert("手机号码不能为空");
				$("#ContactPhone").focus();
				return false;
			}
			if (!myPhone.test($.trim($scope.ContactPhone))) {
				alert("联系电话格式错误");
				$("#ContactPhone").focus();
				return false;
			}
			if (!$scope.DocumentType) {
				alert("证件类型不能为空");
				$("#DocumentType").focus();
				return false;
			}
			if (!$scope.IdentiNumber) {
				alert("证件号码不能为空");
				$("#IdentiNumber").focus();
				return false;
			}
			if (!checkId($scope.IdentiNumber)) {
				alert("证件号码格式错误");
				$("#IdentiNumber").focus();
				return false;
			}
		}
		
		return true;
		
	}
	
	/**
	 * 发送异步请求(信息录入)
	 */
	function infoAddRemote() {
		
		var Operator1 = 0;
		var Operator2 = 0;
		var SpecialOper1 = 0;
		var SpecialOper2 = 0;
		
		if ($scope.Operator1) {
			Operator1 = 1; 
		}
		if ($scope.Operator2) {
			Operator2 = 1;
		}
		if ($scope.SpecialOper1) {
			SpecialOper1 = 1;
		}
		if ($scope.SpecialOper2) {
			SpecialOper2 = 1;
		}
		
		var param = {
				"AccountingNo":$scope.AccountingNo,
				"Phone" : $scope.MsgPhone,
				
				"Operator1Name" : $scope.Operator1Name,
				"Operator1PapersNumber" : $scope.Operator1PapersNumber,
				"Operator1Mobile" : $scope.Operator1Mobile,
				"Operator1Email" : $scope.Operator1Email,
				"Operator1PapersStyle" : $scope.Operator1PapersStyle ? $scope.Operator1PapersStyle.value : null,
				
				"Operator2Name" : $scope.Operator2Name,
				"Operator2PapersNumber" : $scope.Operator2PapersNumber,
				"Operator2Mobile" : $scope.Operator2Mobile,
				"Operator2Email" : $scope.Operator2Email,
				"Operator2PapersStyle" : $scope.Operator2PapersStyle ? $scope.Operator2PapersStyle.value : null,
				
				"SpecialOper1Name" : $scope.SpecialOper1Name,
				"SpecialOper1PapersNumber" : $scope.SpecialOper1PapersNumber,
				"SpecialOper1Mobile" : $scope.SpecialOper1Mobile,
				"SpecialOper1Email" : $scope.Operator2Email,
				"SpecialOper1PapersStyle" : $scope.SpecialOper1PapersStyle ? $scope.SpecialOper1PapersStyle.value : null,
				
				"SpecialOper2Name" : $scope.SpecialOper2Name,
				"SpecialOper2PapersNumber" : $scope.SpecialOper2PapersNumber,
				"SpecialOper2Mobile" : $scope.SpecialOper2Mobile,
				"SpecialOper2Email" : $scope.Operator2Email,
				"SpecialOper2PapersStyle" : $scope.SpecialOper2PapersStyle ? $scope.SpecialOper2PapersStyle.value : null,
				
				"CardholderName" : $scope.CardholderName,
				"ContactPhone" : $scope.ContactPhone,
				"DocumentType" : $scope.DocumentType ? $scope.DocumentType.value : null,
				"IdentiNumber" : $scope.IdentiNumber,
				
				"isSame" : $scope.isSame,
				
				"Operator1":Operator1,
				"Operator2":Operator2,
				"SpecialOper1":SpecialOper1,
				"SpecialOper2":SpecialOper2
		};
		
		$remote.post("/eweb/EntPayAcCheckInfoAdd.do", param, function(data) {
			window.location.href = "/eweb/vx_zh_CN/ToAddCheck/EnterInfoSuccess.html?AccountingNo="+$scope.AccountingNo+"&MsgPhone="+$scope.MsgPhone;
		});
		
	}
	
}
	

//身份证校验
function checkId(str){
	var partten = /^[\d]{6}((19[\d]{2})|(200[0-8]))((0[1-9])|(1[0-2]))((0[1-9])|([12][\d])|(3[01]))[\d]{3}[0-9xX]$/;
  if(partten.test(str)){
	    var truenum = str.substring(0,17);
	    var yzm;
	    nsum = truenum.substring(0,1)* 7;
	    nsum = nsum+truenum.substring(1,2)*9;
	    nsum = nsum+truenum.substring(2,3)*10;
	    nsum = nsum+truenum.substring(3,4)*5;
	    nsum = nsum+truenum.substring(4,5)*8;
	    nsum = nsum+truenum.substring(5,6)*4;
	    nsum = nsum+truenum.substring(6,7)*2;
	    nsum = nsum+truenum.substring(7,8)*1;
	    nsum = nsum+truenum.substring(8,9)*6;
	    nsum = nsum+truenum.substring(9,10)*3;
	    nsum = nsum+truenum.substring(10,11)*7;
	    nsum = nsum+truenum.substring(11,12)*9;
	    nsum = nsum+truenum.substring(12,13)*10;
	    nsum = nsum+truenum.substring(13,14)*5;
	    nsum = nsum+truenum.substring(14,15)*8;
	    nsum = nsum+truenum.substring(15,16)*4;
	    nsum = nsum+truenum.substring(16,17)*2;
	    yzm = 12 - nsum % 11;
	    if (yzm == 10){
	     yzm = 'x';
	    }else if (yzm == 12){
	     yzm = '1';
	    }else if (yzm == 11){
	     yzm = '0';
	    }
	    if (str.substring( 17, 18 ).toLowerCase() == yzm) {
	     	return true;
	    } else {
			return false;
	    }
  }else{
	    return false;
  }
}

//邮箱校验
function isEmail(strEmail) {
	if($.trim(strEmail) == ""){
		return false;
	}
	if ($.trim(strEmail).search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
		return true;
	else
		return false;
}

	//手机号校验规则
	var myPhone = /^(((13[0-9]{1})|14[0-9]{1}|15[0-9]{1}|16[0-9]{1}|17[0-9]{1}|18[0-9]{1}|19[0-9]{1}|)+\d{8})$/;
	var card = /^(([0-9]{1})+\d{10})$/;
	var cardT = /^([A-Za-z0-9\-]{1,20})$/;
	//英文
	var en = /^[0-9a-zA-Z\s?,.()（）]+$/;  
	
	function check(strId){
		if(/\D/.test($.trim(strId))){
			return false;
		}else{
			return true;
		}
	}
	
	function checkDate(strId) {
		//验证是否为8为数字
		if($("#"+strId).val().length != "8" || !/\D/.test($.trim(strId))){
			return false;
		}
		
		//取出年、月、日分别判断是否合法
		var date = $("#"+strId).val();
		var fmt="yyyyMMdd";
		var yIndex = fmt.indexOf("yyyy");
		if(yIndex==-1) 
			return false;
		var year = date.substring(yIndex,yIndex+4);
		var mIndex = fmt.indexOf("MM");
		if(mIndex==-1) 
			return false;
		var month = date.substring(mIndex,mIndex+2);
		var dIndex = fmt.indexOf("dd");
		if(dIndex==-1) 
			return false;
		var day = date.substring(dIndex,dIndex+2);
		if(month>"12" || month< "01") 
			return false;
		if(day>getMaxDay(year,month) || day< "01") 
			return false;
		
		//验证是否大于系统当前日期
		var nowY = new Date().getFullYear();
		var nowM = new Date().getMonth() + 1;
		var nowD = new Date().getDate();
		if(year < nowY){
			return false;
		}else if(year == nowY){
			if(month < nowM){
				return false;
			}else if(month == nowM){
				if(day < nowD){
					return false;
				}
			}
		}
		
		return true;
	}
	//判断某月份的天数
	function getMaxDay(year,month) {
		if(month==4||month==6||month==9||month==11)
			return "30";
		if(month==2){
			if(year%4==0&&year%100!=0 || year%400==0)
				return "29";
			else
				return "28";
		}
		return "31";
	}
	
	/**
	 * 获取URL中参数
	 * @param name
	 * @returns
	 */
	function getUrlParam(name) {
	    var url = window.location.href;
	    if(url!=null && url.indexOf("?")!=-1){
	        var url_param = url.split("?")[1];
	        var url_param_arr = url_param.split("&");
	        for(var i=0;i<url_param_arr.length;i++){
	            var tempParam = url_param_arr[i];
	            var paramName =  tempParam.split("=")[0];
	            if(paramName==name){
	                return tempParam.split("=")[1]
	            }
	        }
	    }
	    return null;
	}






























